package com.superlistaportable.resultList;

import com.example.superlistaportable.R;

import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

public class ResultListView  extends View {
	private final ResultListActivity activity;
	private final ResultListModel model;
	
	public ResultListView(ResultListActivity activity, ResultListModel model) {
		super(activity, null);
		
		this.activity = activity;
		this.model = model;
		activity.setContentView(R.layout.result_list);
	}
	
    public void ocultarBotonesYTexto(){ 
    	activity.findViewById(R.id.textoSeleccion).setVisibility(View.INVISIBLE);
    	activity.findViewById(R.id.buttonCalendario).setVisibility(View.INVISIBLE);
    }
    
    public Button getButtonCalendario(){
    	return (Button) activity.findViewById(R.id.buttonCalendario);
    }
    
    public ListView getListResult(){
    	return (ListView) activity.findViewById(R.id.listItemsSeleccionados);
    }
    
    public void setTotal(){
    	TextView total = (TextView) activity.findViewById(R.id.total);
    	total.setText("Total $" + model.getTotal());
    	
    }
}
